package com.zh.business.service.web.common;


import com.zh.zhbootcommon.entity.user.User;

import javax.servlet.http.HttpServletRequest;

/**
 * 描述: Token
 *
 * @author: yanglin
 * @Date: 2021-08-31-8:58
 * @Version: 1.0
 */
public interface TokenService {

    /**
     * 创建JWT-token
     * @return
     */
    String createJwtToken(User user);

    /**
     * 创建幂等性token
     * @return
     */
    String createToken();

    /**
     * 创建幂等性token
     * 根据传递参数
     * @return
     */
    String createToken(HttpServletRequest request);

    /**
     * 检验幂等性token
     * @param request
     * @return
     */
    boolean checkToken(HttpServletRequest request) throws Exception;

}
